import { BaseCacheService } from '@app/base-cache';
import { CACHE_MANAGER } from '@nestjs/cache-manager';
import { Inject, Injectable } from '@nestjs/common';
import Redis from 'ioredis';
import { Cache, Store } from 'cache-manager'

type Client = {
    client:Redis
}

@Injectable()
export class CachingService extends BaseCacheService{
    constructor(@Inject(CACHE_MANAGER) private cacheManager: Cache<Client & Store>){
        super()

        this.Client = this.cacheManager.store.client as Redis
    }
}
